package com.ruoyi.web.controller.app;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.wb.domain.WbInform;
import com.ruoyi.wb.service.IWbInformService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * 消息Controller
 *
 * @author ruoyi
 * @date 2024-10-14
 */
@Api(tags="app端-消息列表管理")
@RestController
@RequestMapping("/wb/app/wbInform")
public class WbAppInformController extends BaseController {

    @Autowired
    private IWbInformService wbInformService;

    @ApiOperation("查询当前用户消息")
    @GetMapping("/getMessageList")
    public TableDataInfo getMessageList(WbInform wbInform) {
        startPage();
        List<WbInform> list = wbInformService.selectWbInformList(wbInform);
        return getDataTable(list);
    }

    @ApiOperation("修改消息")
    @GetMapping(value = "/updateMessage")
    public AjaxResult getInfo(@RequestParam("id") Long id) {
        WbInform inform = new WbInform();
        inform.setId(id);
        inform.setIfRead(1L);
        wbInformService.updateWbInform(inform);
        return success();
    }
}